package entry.options;

import enums.OptionsTextTypeEnums;
import enums.TextAlignEnums;
import enums.TextVerticalAlignEnums;
import lombok.Data;

/**
 * @Author LS
 * @Date 2023/4/16 23:06
 * @Description
 **/

@Data
public class LongTextOptions extends Options{

    // 标题
    private String title;

    // 字段名
    private String field;

    // 测试数据
    private String testData;

    // 字体
    private String fontFamily;

    // 字体大小
    private double fontSize = 9;

    // 字体粗细
    private String fontWeight = "plain";

    // 字符间距
    private double letterSpacing;

    // 字体颜色
    private String color;

    // 文本修饰
    private String textDecoration;

    // 左右对齐
    private TextAlignEnums textAlign = TextAlignEnums.LEFT;

    // 上下对齐
    private TextVerticalAlignEnums textContentVerticalAlign = TextVerticalAlignEnums.TOP;

    // 字体行高
    private double lineHeight;

    // 打印类型
    private OptionsTextTypeEnums textType = OptionsTextTypeEnums.TEXT;

//    // 条码格式 todo
//    private String barcodeMode;

    // 标题展示隐藏
    private boolean hideTitle = false;

    // 显示规则 todo
    private String showInPage;

    // 隐藏规则
    private String unShowInPage;

    // 位置固定
    private boolean fixed;

    // 拖动方向
    private String axis;

    // 旋转角度
    private double transform;

    // 左边框
    private String borderLeft;

    // 上边框
    private String borderTop;

    // 右边框
    private String borderRight;

    // 下边框
    private String borderBottom;

    // 边框大小
    private String borderWidth;

    // 边框颜色
    private String borderColor;

    // 左内边距
    private double contentPaddingLeft;

    // 上内边距
    private double contentPaddingTop;

    // 右内边距
    private double contentPaddingRight;

    // 下内边距
    private double contentPaddingBottom;

    // 背景色
    private String backgroundColor;

    // 格式化函数
    private String formatter;

    // 样式函数
    private String styler;

    public TextOptions convertToTextOptions(){
        return TextOptions.builder()
                .title(this.title)
                .field(this.title)
                .testData(this.testData)
                .fontFamily(this.fontFamily)
                .fontSize(this.fontSize)
                .fontWeight(this.fontWeight)
                .letterSpacing(this.letterSpacing)
                .color(this.color)
                .textDecoration(this.textDecoration)
                .textAlign(this.textAlign)
                .textContentVerticalAlign(this.textContentVerticalAlign)
                .lineHeight(this.lineHeight)
                .textType(this.textType)
                .hideTitle(this.hideTitle)
                .showInPage(this.showInPage)
                .unShowInPage(this.unShowInPage)
                .fixed(this.fixed)
                .axis(this.axis)
                .transform(this.transform)
                .borderLeft(this.borderLeft)
                .borderTop(this.borderTop)
                .borderRight(this.borderRight)
                .borderBottom(this.borderBottom)
                .borderWidth(this.borderWidth)
                .borderColor(this.borderColor)
                .contentPaddingLeft(this.contentPaddingLeft)
                .contentPaddingTop(this.contentPaddingTop)
                .contentPaddingRight(this.contentPaddingRight)
                .contentPaddingBottom(this.contentPaddingBottom)
                .backgroundColor(this.backgroundColor)
                .formatter(this.formatter)
                .styler(this.styler)
                .build();
    }
}
